import request from '@/utils/request'

export function getRoles(data) {
  return request({
    url: '/admin/roles',
    method: 'get',
    params: data
  })
}

export function addRole(data) {
  return request({
    url: '/admin/roles',
    method: 'post',
    data
  })
}

export function updateRole(data) {
  return request({
    url: '/admin/roles/' + data.id,
    method: 'put',
    data
  })
}

export function delRole(id) {
  return request({
    url: '/admin/roles/' + id,
    method: 'delete'
  })
}
export function allRole() {
  return request({
    url: '/admin/all_role',
    method: 'get'
  })
}

export function getRoleShow(id) {
  return request({
    url: '/admin/roles_show/' + id,
    method: 'get'
  })
}
